package com.wits.media;

public class Rgb {
	
	public int a;
	public int r;
	public int g;
	public int b;
	
	public Rgb(int color) {
		this.a = alpha(color);
		this.r = red(color);
		this.g = green(color);
		this.b = blue(color);
	}
	
	public Rgb(int r, int g, int b) {
		this.a = 0;
		this.r = r;
		this.g = g;
		this.b = b;
	}
	
	public Rgb(int a, int r, int g, int b) {
		this.a = a;
		this.r = r;
		this.g = g;
		this.b = b;
	}

	public static int argb(int a, int r, int g, int b) {
		return (r) | ((g)<<8) | ((b)<<16) | ((a) <<24);
	}
	
	public static int rgb(int r, int g, int b) {
		return (r) | ((g)<<8) | ((b)<<16);
	}
	
	public static int alpha(int color) {
		return (color >> 24) & 0xff;
	}
	
	public static int red(int color) {
		return (color >> 16) & 0xff;
	}
	
	public static int green(int color) {
		return (color >> 8) & 0xff;
	}

	public static int blue(int color) {
		return (color ) & 0xff;
	}
	
	
}
